
##############################################		
###need complete cases so subset below		

###reduced version
use.formula = as.formula(paste('in.out.diff.dictator ~ ',master.formula,sep = ''))
use.formula.reduced = as.formula(paste('in.out.diff.dictator ~ ',master.formula.reduced,sep = ''))

use.vars = c('in.out.diff.dictator',master.use.vars)



################################################
use.dat.uo = dat.uo[,use.vars]
use.dat.uo = dat.uo[dat.uo$index.city != city ,use.vars]
use.dat.uo = use.dat.uo[complete.cases(use.dat.uo),]

reg.uo.dict.reduced = lm(use.formula.reduced, data = use.dat.uo)
clustered.se = cl(use.dat.uo, reg.uo.dict.reduced, use.dat.uo$index.city)
reg.uo.dict.reduced$se = clustered.se

reg.uo.dict = lm(use.formula, data = use.dat.uo)
clustered.se = cl(use.dat.uo, reg.uo.dict, use.dat.uo$index.city)
reg.uo.dict$se = clustered.se  ##note that this does not show up in the object until apsrtable() is applied so summary(reg.uo.dict) will show hte wrong standard errors

use.dat.sec = dat.non.uo[,use.vars]
use.dat.sec = dat.non.uo[dat.non.uo$index.city != city ,use.vars]
use.dat.sec = use.dat.sec[complete.cases(use.dat.sec),]

reg.sec.dict.reduced = lm(use.formula.reduced, data = use.dat.sec)
clustered.se = cl(use.dat.sec, reg.sec.dict.reduced, use.dat.sec$index.city)
reg.sec.dict.reduced$se = clustered.se

reg.sec.dict = lm(use.formula, data = use.dat.sec)
clustered.se = cl(use.dat.sec, reg.sec.dict, use.dat.sec$index.city)
reg.sec.dict$se = clustered.se

